home *** CD-ROM | disk | FTP | other *** search
/ PCMania 49 / PCMania CD49_3.iso / INFOVIA / WIN31 / TOUGH.SCR < prev    next >
Text File  |  1994-10-07  |  2KB  |  77 lines

  1. <* Example SLANG script                         11 Mar 94    language=slang
  2.  * This script is an example of a simple login session.
  3.  *
  4.  * Change "klingon" to a string the host you want to log into transmits
  5.  * when you make a connection.
  6.  *
  7.  * Change foo-slip to your slip userid.
  8.  *>
  9.  
  10. (define,host1,bogus_host)
  11. (define,host2,klingon)
  12.  
  13. (define,number1,96590000)
  14. (define,number2,96591000)
  15.  
  16. (define,login,{
  17.     (output,{Attempting connection to }(value,host(loopnum)){ at }(value,number(loopnum)){
  18. })
  19.     (send,ATDT(value,number(loopnum))(cr))
  20.     (define,data,(receive,60000,login:))
  21.     (has,data,(value,host(loopnum)),{
  22.         (send,(output,{User Id?  })(input)(cr))
  23.         (define,data,(receive,15000,Password:))
  24.         (has,data,password,{
  25.             (conecho,off)
  26.             (send,(output,{Connected to }(value,host(loopnum)){, password please? })(input)(cr))
  27.         })
  28.     },{
  29.         (output,(value,host(loopnum)){ connection failed.
  30. }){Login Failed}
  31.     })
  32. })
  33.  
  34. (define,try_to_login,{
  35.     (loop,{
  36.         (define,return,(login))
  37.         (has,return,Failed,
  38.             {(hangup)},
  39.             {(do_network_stuff_and_quit)}
  40.         )
  41.     },2)
  42.     {All Logins Failed}
  43. })
  44.  
  45. (define,log_me_in,{
  46.     (loop,{
  47.         (define,return,(try_to_login))
  48.         (has,return,Failed,{
  49.             (output,{Login[s] failed.  Want to try again [y/n] })
  50.       (==,(input),y,,{(break)})
  51.   })
  52.     },-1)
  53. })
  54.  
  55. (define,hangup,{
  56.     (output{...Hanging up....
  57. })
  58.     (define,discard,(receive,1000))
  59.     (send,+++)
  60.     (pause,1000)
  61.     (send,ath(cr))
  62.     (pause,1000)
  63.     (send,atz(cr))
  64.     (define,discard,(receive,1000))
  65. })
  66.  
  67. (define,do_network_stuff_and_quit,{
  68.     (output{(shell,{c:\local\mpcmail -o -z})})
  69.     (start,c:\local\vmail,-o)
  70.     (output,(receive,2000))
  71.     (hangup)
  72.     (exit)
  73. })
  74.  
  75. (log_me_in)
  76. (exit)
  77.